Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create new release including "alpha" Linux support #173

Merged
merged 88 commits into from
Sep 22, 2020
Merged

Conversation

mjcheetham
Copy link
Collaborator

Create a new release that includes basic support for Linux platforms, as well as many bug fixes and enhancements to credential storage/lookup with multiple users and custom port numbers!

mjcheetham and others added 30 commits June 29, 2020 13:39
Split out the IGit and IGitConfiguration interfaces and extension
methods in to their own files.
Add ability to locate executables on the current PATH by shelling out to
`which` on UNIX platforms, and `where.exe` on Windows.
Implement IGit and IGitConfiguration components using the Git CLI
executable, rather than libgit2.
Update the use of the Git configuration components in the configuration
service and configurable components; used to set up a system during
install.
Add an implementation of the IFileSystem component for Linux
distributions. We just simply assume that all file systems are
case-sensitive at the moment.

Also introduce a (empty) PosixFileSystem class shared between macOS and
Linux.
Implement a stub ISystemPrompts component that just throws.
The component is currently not used on any platform that's not Windows
anyway so this won't be hit.
Implement a credential store for Linux platforms that use the libsecret
Secret Service API.
Update the Nerdbank.GitVersioning package to the latest to fix a bug
where the package would fail to execute due to libgit2 dependency
issues.
Extend the PR and CI build to produce a tarball of binaries for Linux
x86_64 platforms; building on Ubuntu 18.04 LTS.

The release build does not publish anything currently as we need to get
signing working.
Rewrite the libsecret and glib interop code for the Linux
ICredentialStore implementation to be more thorough.
Introduce a credential store for Linux that passes through to a backing
store that is selected based on user preference and session features.

Currently this is a stub that just uses LibsecretCollection (which only
works in a GUI environment).
Rename the LibsecretCollection type to SecretService API to more
accurately reflect the API we're using.
Ensure the PR build is triggered on PRs into master or release.
Also now that we're making real releases of GCM Core on GitHub and not
just pre-releases, move to the simpler syntax/API calls for the Action
that creates and updated the Homebrew cask on release publish.
On release, automatically update the Homebrew Cask in the microsoft/git
Tap.
Automatically update Homebrew Cask on release
Make OAuth the default authentication mode.
Move the OAuth/login with browser option to the top of the Windows
GitHub login dialog when both user/pass and OAuth options are available.
Replace the "login using browser" link with a button on the Windows
GitHub login dialog.
Make OAuth the default authentication mechanism for GitHub provider
Update the generic host provider to support the new credential storage
model and HostProvider base class APIs.
Update the Basic authentication component to match the new ICredential
interface.
Update the BitBucket provider to support and implement the new
credential storage/recall model and APIs.
Update the GitHub provider to implement and follow the new credential
storage/recall/matching model and ICredentialStore APIs.
Update the Azure Repos provider to support the new credential storage
API/model, as well as support remote URLs with explicit port numbers.
Now that we support multiple user accounts for each host/service/remote,
we have hit an interesting issue with Azure Repos.

With the introduction of the dev.azure.com-style URLs for Azure Repos
there was an unfortunate hack or workaround invented to add the AzDevOps org name
to the userinfo part of the remote URL, for example: org@dev.azure.com/org/blah.

Since GCM for Windows (and older versions of GCM Core that initially followed
the same model) always uses the value "PersonalAccessToken" for the username field
when storing credentials it was free to ignore the user part of the input.

The problem now is that since we support multiple user accounts, and will perform
an exact match against the credential (with user) if a username is specified in
the remote URL, we never find the credential we now store (we now always store
with the actual, real users' UPN).

To workaround this workaround (yuck) we ignore the username IF AND ONLY IF the
host is dev.azure.com, and return the first matching dev.azure.com/org
credential. The upshot of this is that dev.azure.com-style URLs do NOT
support multiple users OR full paths, however vs.com-style URLs will.
Add support for customising the namespace/prefix used to store
credentials in the OS credential store.

By default we use "git:{service}". Users can use GCM_NAMESPACE or
credential.namespace to set this to something different.

These configuration options are the same as in GCM for Windows to help
with migration.
Update the GCM Core Host Provider spec document and architecture
document to reflect the changes made to the abstract HostProvider
class; replacing GetCredentialKey with GetServiceName.
Fix a bug in the WindowsEnvironment implementation of the
LocateExectuable method. On .NET Core the UseShellExecute property of
ProcessStartInfo defaults to false, whereas on .NET Framework (the
runtime that we target on Windows) defaults to true. You must set this
to false if you want to redirect standard streams (which we want to do).

The .NET Framework-targeting build on Windows was throwing an exception
here(!)
Revamp credential storage system to allow for smarter searching
Now that we have the GCM OAuth application in the allow-list for GitHub
apps, we no longer need to offer username/password authentication for
github.com!
Fix a typo in a constant variable indicating the available
authentication modes for github.com.
Remove username/password authentication for github.com
Change how we construct the existing credential stores by simply new-ing
them up, rather than calling a static `Open` method.
Add a plaintext credential store option for Linux. Credentials are
stored in plaintext files, by default in ~/.gcm/store, but configurable
by settings/environment variables.

Users can select between the Secret Service API and plaintext-based
credential storage using the GCM_CREDENTIAL_STORE setting.
Refactor the PlatformFact attribute to support a flags enum, such that
compound platforms can be specified (e.g., Posix = Linux | Mac).
Add a `pass` compatible credential store that uses GPG to store
encrypted credentials in files on disk. Defaults to the default `pass`
password store, but can be overriden using standard `pass` envars.
Add a document outlining the different credential stores available on
Linux.
Extract the Linux Credential Store option constant values.
Add a variety of credential stores on Linux
@mjcheetham mjcheetham added enhancement New feature or request platform:linux Specific to a Linux-based platform labels Sep 21, 2020
@mjcheetham mjcheetham merged commit a87e1e5 into release Sep 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request platform:linux Specific to a Linux-based platform
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants